package org.example.easybuy.util;

import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Arrays;
import java.util.Base64;


public class MD5Util {
    private MD5Util() {

    }
    public static String getMd5(String wantLockStr) throws NoSuchAlgorithmException, UnsupportedEncodingException {
        MessageDigest messageDigest=MessageDigest.getInstance("MD5");
        String newStr= Base64.getEncoder().encodeToString(messageDigest.digest(wantLockStr.getBytes("UTF-8")));
        return newStr;
    }
}
